using NExt.Core.Model.Base;
using NExt.UI.Base.Js;
using NExt.UI.Base.Presenter;
using NExt.UI.Browse.Data;

namespace NExt.UI.Find.Base
{
    public class FindPresenterBase : PresenterDefault
    {
        public Button btnOk;
        public Button btnCancel;

        protected IScript fireOk;
        protected IScript fireCancel;

        protected override void FormBuildComponents()
        {
            base.FormBuildComponents();
            this.btnOk = new Button();
            this.btnCancel = new Button();
        }

        protected override void FormBuildEvents()
        {
            base.FormBuildEvents();
            fireOk = new ExternalJs("fireOk");
            fireCancel = new ExternalJs("fireCancel");
        }

        protected override void FormInitializeComponents()
        {
            base.FormInitializeComponents();

            this.buttonAlign = "center";

            btnOk.text = "OK";
            btnOk.minWidth = 75;
            btnOk.handler = fireOk;

            btnCancel.text = "Cancel";
            btnCancel.minWidth = 75;
            btnCancel.handler = fireCancel;

            buttons.Add(btnOk);
            buttons.Add(btnCancel);

        }
    }
}